<?php
global $_W, $_GPC;
$categoryid = $_GPC['categoryid'];
//文章列表
$contion = ' weid = :weid and status = :status ';
$params = [':weid' => $_W['uniacid'], ':status' => 1];
if (!empty($categoryid)) {
    $contion .= ' and cid = :cid ';
    $params[':cid'] = $categoryid;
} else {
    $contion .= " and recommond = 1 ";
}
$page = max(1, $_GPC['page']);
$pindex = 8;
$articlelist = pdo_fetchall("select * from " . tablename($this->t_article) . " where " . $contion . " order by `order` DESC LIMIT " . ($page - 1) * $pindex . "," . $pindex, $params);
foreach ($articlelist as $k => $v) {
    $articlelist[$k]['image'] = $_W['attachurl'] . $v['image'];
    $articlelist[$k]['content'] = htmlspecialchars_decode($v['content'],true);
}
$total = pdo_fetchcolumn("select count(*) from " . tablename($this->t_article) . " where " . $contion, $params);
return $this->getresult(0, '咨询页面数据', array('code'=>200,'total' => $total, 'articlelist' => $articlelist));
